#pragma once
#include <cocos2d.h>

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "EziSocialObject.h"
#include "EziSocialDelegate.h"
#include "EziFacebookFriend.h"
#include "EziFBIncomingRequestManager.h"
#include "EziFBIncomingRequest.h"
#endif


USING_NS_CC;

class MainScene : public CCLayer
// #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// 	,public EziSocialDelegate
// #endif
{
public:
	MainScene(void);
	~MainScene(void);

	virtual bool init();

	virtual void onEnter();
	virtual void onExit();

	virtual void keyBackClicked();


	/* UI */
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblGold, LableGold);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblUserLevel, UserLevel);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneId, PlaneId);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneType, PlaneType);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneLevel, PlaneLevel);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneDamage, PlaneDamage);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneHealth, PlaneHealth);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneSpeed, PlaneSpeed);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPlaneWeapon, PlaneWeapon);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPetType, PetType);
	CC_SYNTHESIZE_RETAIN(CCLabelTTF*, _lblPetWeapon, PetWeapon);

	float _planeIdIndex;
	float _petIdIndex;

	/* */
	void callBackStartClick(CCObject* sender);
	void callbackPlayerWeaponUp(CCObject* sender);
	void callbackPlayerWeaponDown(CCObject* sender);
	void callbackPlaneIdUp(CCObject* sender);
	void callbackPlaneIdDown(CCObject* sender);
	void callbackPetIdUp(CCObject* sender);
	void callbackPetIdDown(CCObject* sender);
	void callbackFBLoginClick(CCObject* sender);

	/* Ezibyte function */
	virtual void fbSessionCallback(int responseCode, const char* responseMessage);

	void updatePlaneInfo();

	CREATE_FUNC(MainScene);
	static CCScene* scene();
};

